package com.kantboot.business.common.web.admin.controller;

import com.kantboot.business.common.domain.entity.BusCommonCarouselImage;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.controller.BaseAdminController;
import com.kantboot.util.core.redis.RedisUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/business-common-web/admin/carouselImage")
public class BusCommonCarouselImageControllerOfAdmin extends BaseAdminController<BusCommonCarouselImage,Long> {

    @Resource
    private RedisUtil redisUtil;

    @RequestMapping(value = "/save")
    @Override
    public RestResult<Object> save(@RequestBody BusCommonCarouselImage busCommonCarouselImage) {
        // 删除对应的国际化缓存
        redisUtil.deleteByPrefix("carouselImageI18n:");
        return super.save(busCommonCarouselImage);
    }

    @RequestMapping(value = "/remove")
    @Override
    public RestResult<BusCommonCarouselImage> remove(BusCommonCarouselImage busCommonCarouselImage) {
        // 删除对应的国际化缓存
        redisUtil.deleteByPrefix("carouselImageI18n:");
        return super.remove(busCommonCarouselImage);
    }
}
